1. Technical Field
This invention generally relates to computer systems and more specifically relates to an apparatus and method for accessing information stored in a computer system.
2. Background Art
Since the dawn of the computer era, computer systems have evolved into extremely sophisticated devices that may be found in many different settings. Computer systems typically include a combination of hardware (e.g., semiconductors, circuit boards, etc.) and software (e.g., computer programs). As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago.
Many modern computer systems are a complex combination of different hardware and software that are interconnected on a network. One network that has gained in importance and popularity in recent years is the Internet. A user typically accesses information on the Internet using a web browser that receives information in Hypertext Markup Language (HTML). HTML is typically organized into xe2x80x9cpagesxe2x80x9d of information, with various xe2x80x9celementsxe2x80x9d making up components on each page. When a user-accesses a web page using a browser, a server computer system locates the HTML elements that make up the page and serves up the page to the requesting web browser.
Recent developments have improved the manner for web servers to render web pages. In the past, web pages were rendered by a hybrid mixture of code and HTML elements. However, progress has been made in segregating the code that renders a web page from the HTML elements that make up the web page. For example, Sun Microsystems has developed a Java construct known as a JavaServer Page (JSP). All of the HTML elements on a page are written to a JSP file, which can then be read by code that needs to render the web page. The result is a separation between the code that renders the page and the HTML elements that make up the page, thereby allowing web page designers to design web pages without concern for the code that renders the page, and allowing programmers to render a web page by simply processing a JSP in a predefined manner. In this manner the code that renders a web page is separate from the creative HTML elements that make up the page. Microsoft Corporation has also come up with a similar way to separate code from HTML elements known as ActiveServer Page (ASP). Both JSP and ASP files are examples of xe2x80x9cHTML filesxe2x80x9d.
The Related Application referenced above discloses a way to access HTML elements in an HTML web page using a structured query language (SQL) query. This is useful on the browser, where browsers read HTML pages. However, there is currently no known mechanism or method for using SQL on the server side to access elements in an HTML file, such as a JSP or ASP. Without an apparatus and method for accessing data in an HTML file using SQL, the computer industry will continue to suffer from inefficient ways of accessing HTML files.
According to the preferred embodiments, an apparatus and method allow accessing data in an HTML file (such as a JSP or ASP file) via an SQL query. A database table is created for each HTML file, and a record is created in each database table that corresponds to each HTML element in the corresponding HTML file. A cross-reference is then created that correlates the HTML file to its corresponding database table. An SQL engine in accordance with the preferred embodiments then processes an SQL query that specifies an HTML file and one or more elements in the HTML file by using the cross-reference information to formulate a new SQL query that accesses the corresponding database table rather than the specified HTML file. When a database table is updated by an SQL query, the corresponding HTML file is re-generated from the data in the database table. In this manner the SQL engine generates a query that accesses a database table from the original query that uses the corresponding HTML file. The preferred embodiments thus disclose apparatus and methods for accessing HTML files using SQL. In this manner, the present invention provides all the power and flexibility of SQL when accessing data in an HTML file.
The foregoing and other features and advantages of the invention will be apparent from the following more particular description of preferred embodiments of the invention, as illustrated in the accompanying drawings.